From c3701eddb447881b16cc1ebd902941eb92ac65f3 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 14 Sep 2018 15:37:09 +0100 Subject: [PATCH] d/missing-sources: Remove, no longer needed --- debian/changelog | 1 + debian/copyright | 7 - debian/missing-sources/README | 39 - debian/missing-sources/rawinflate.js | 1 - .../zlib.js-0.1.6/ChangeLog.md | 133 -- debian/missing-sources/zlib.js-0.1.6/LICENSE | 28 - .../missing-sources/zlib.js-0.1.6/LICENSE_min | 1 - .../zlib.js-0.1.6/README.en.md | 285 ---- .../missing-sources/zlib.js-0.1.6/README.md | 307 ---- .../zlib.js-0.1.6/bin/rawinflate.min.js | 15 - .../zlib.js-0.1.6/bin/rawinflate.min.js.map | 8 - .../missing-sources/zlib.js-0.1.6/build.xml | 451 ----- .../zlib.js-0.1.6/closure-primitives/base.js | 1498 ----------------- .../closure-primitives/depswriter.py | 202 --- .../closure-primitives/source.py | 114 -- .../closure-primitives/treescan.py | 78 - .../zlib.js-0.1.6/define/typedarray/hybrid.js | 14 - .../zlib.js-0.1.6/define/typedarray/use.js | 9 - debian/missing-sources/zlib.js-0.1.6/deps.js | 25 - .../zlib.js-0.1.6/export/adler32.js | 4 - .../zlib.js-0.1.6/export/crc32.js | 5 - .../zlib.js-0.1.6/export/deflate.js | 17 - .../zlib.js-0.1.6/export/gunzip.js | 11 - .../zlib.js-0.1.6/export/gunzip_member.js | 15 - .../zlib.js-0.1.6/export/gzip.js | 7 - .../zlib.js-0.1.6/export/inflate.js | 12 - .../zlib.js-0.1.6/export/inflate_stream.js | 11 - .../zlib.js-0.1.6/export/rawdeflate.js | 21 - .../zlib.js-0.1.6/export/rawinflate.js | 12 - .../zlib.js-0.1.6/export/rawinflate_stream.js | 11 - .../zlib.js-0.1.6/export/unzip.js | 15 - .../zlib.js-0.1.6/export/zip.js | 33 - .../zlib.js-0.1.6/node/exports.js | 230 --- .../zlib.js-0.1.6/node/externs.js | 13 - .../zlib.js-0.1.6/package.json | 29 - .../zlib.js-0.1.6/src/adler32.js | 68 - .../zlib.js-0.1.6/src/bitstream.js | 202 --- .../zlib.js-0.1.6/src/crc32.js | 142 -- .../zlib.js-0.1.6/src/deflate.js | 168 -- .../zlib.js-0.1.6/src/export_object.js | 33 - .../zlib.js-0.1.6/src/gunzip.js | 238 --- .../zlib.js-0.1.6/src/gunzip_member.js | 51 - .../missing-sources/zlib.js-0.1.6/src/gzip.js | 225 --- .../missing-sources/zlib.js-0.1.6/src/heap.js | 135 -- .../zlib.js-0.1.6/src/huffman.js | 93 - .../zlib.js-0.1.6/src/inflate.js | 120 -- .../zlib.js-0.1.6/src/inflate_stream.js | 119 -- .../zlib.js-0.1.6/src/rawdeflate.js | 1195 ------------- .../zlib.js-0.1.6/src/rawinflate.js | 861 ---------- .../zlib.js-0.1.6/src/rawinflate_stream.js | 862 ---------- .../zlib.js-0.1.6/src/unzip.js | 565 ------- .../missing-sources/zlib.js-0.1.6/src/util.js | 31 - .../missing-sources/zlib.js-0.1.6/src/zip.js | 571 ------- .../missing-sources/zlib.js-0.1.6/src/zlib.js | 24 - debian/source/lintian-overrides | 2 - 55 files changed, 1 insertion(+), 9366 deletions(-) delete mode 100644 debian/missing-sources/README delete mode 100644 debian/missing-sources/rawinflate.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/ChangeLog.md delete mode 100644 debian/missing-sources/zlib.js-0.1.6/LICENSE delete mode 100644 debian/missing-sources/zlib.js-0.1.6/LICENSE_min delete mode 100644 debian/missing-sources/zlib.js-0.1.6/README.en.md delete mode 100644 debian/missing-sources/zlib.js-0.1.6/README.md delete mode 100644 debian/missing-sources/zlib.js-0.1.6/bin/rawinflate.min.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/bin/rawinflate.min.js.map delete mode 100644 debian/missing-sources/zlib.js-0.1.6/build.xml delete mode 100644 debian/missing-sources/zlib.js-0.1.6/closure-primitives/base.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/closure-primitives/depswriter.py delete mode 100644 debian/missing-sources/zlib.js-0.1.6/closure-primitives/source.py delete mode 100644 debian/missing-sources/zlib.js-0.1.6/closure-primitives/treescan.py delete mode 100644 debian/missing-sources/zlib.js-0.1.6/define/typedarray/hybrid.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/define/typedarray/use.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/deps.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/adler32.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/crc32.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/deflate.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/gunzip.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/gunzip_member.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/gzip.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/inflate.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/inflate_stream.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/rawdeflate.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/rawinflate.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/rawinflate_stream.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/unzip.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/export/zip.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/node/exports.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/node/externs.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/package.json delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/adler32.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/bitstream.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/crc32.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/deflate.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/export_object.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/gunzip.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/gunzip_member.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/gzip.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/heap.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/huffman.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/inflate.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/inflate_stream.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/rawdeflate.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/rawinflate.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/rawinflate_stream.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/unzip.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/util.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/zip.js delete mode 100644 debian/missing-sources/zlib.js-0.1.6/src/zlib.js delete mode 100644 debian/source/lintian-overrides diff --git a/debian/changelog b/debian/changelog index bdda2a0c7b..09585d4f08 100644 --- a/debian/changelog +++ b/debian/changelog @@ -56,6 +56,7 @@ gtk+4.0 (3.94.0-1) UNRELEASED; urgency=medium * d/rules: Defang dh_auto_test when built with nocheck * Stop using Priority: extra * d/tests/build: Update for GTK+ 4.0 + * d/missing-sources: Remove, no longer needed -- Jeremy Bicha Fri, 19 Jan 2018 22:05:35 -0500 diff --git a/debian/copyright b/debian/copyright index c0a1266596..74a22cfcb6 100644 --- a/debian/copyright +++ b/debian/copyright @@ -584,13 +584,6 @@ Copyright: Copyright (C) 1992-1994 The Regents of the University of California. Copyright (C) 2000 Red Hat, Inc. License: LGPL-2+ or sun-permissive -Files: - debian/missing-sources/zlib.js-0.1.6 - gdk/broadway/rawinflate.min.js -Copyright: - © 2012 imaya -License: Expat - Files: gtk/inspector/logs.* Copyright: diff --git a/debian/missing-sources/README b/debian/missing-sources/README deleted file mode 100644 index 778e6e6a58..0000000000 --- a/debian/missing-sources/README +++ /dev/null @@ -1,39 +0,0 @@ -Missing sources from gtk+3.0 -============================ - -zlib.js-0.1.6 -------------- - -Source for: gdk/broadway/rawinflate.min.js -Obtained from: tag "0.1.6" -Files removed: - bin/* except for rawinflate.min.js* (precompiled, not needed here) - .travis/, .travis.yml (regression tests, not needed here) - test/ (regression tests, not needed here) - vendor/google-closure-compiler/ (third-party, source not included) - vendor/mt.js/ (third-party, only needed for tests) - -gdk/broadway/rawinflate.min.js is identical to bin/rawinflate.min.js. - -Debian's closure-compiler_20130227+dfsg1-6 is not identical to the one -originally distributed with zlib.js, but produces output closely resembling -bin/rawinflate.min.js when invoked like this (command line adapted from -build.xml, using bin/rawinflate.min.js.map to determine minimal sources): - - cat LICENSE_min - echo -n '(function() {' - closure-compiler --compilation_level=ADVANCED_OPTIMIZATIONS \ - --warning_level=VERBOSE \ - --define=goog.DEBUG=false \ - --summary_detail_level=3 \ - --language_in=ECMASCRIPT5_STRICT \ - --source_map_format=V3 \ - --process_closure_primitives \ - --js closure-primitives/base.js \ - --js define/typedarray/hybrid.js \ - --js=src/export_object.js \ - --js=src/huffman.js \ - --js=src/rawinflate.js \ - --js=src/zlib.js \ - --js=export/rawinflate.js - echo -n '}).call(this); //@ sourceMappingURL=rawinflate.min.js.map' diff --git a/debian/missing-sources/rawinflate.js b/debian/missing-sources/rawinflate.js deleted file mode 100644 index 98a73f52a6..0000000000 --- a/debian/missing-sources/rawinflate.js +++ /dev/null @@ -1 +0,0 @@ -zlib.js-0.1.6/src/rawinflate.js \ No newline at end of file diff --git a/debian/missing-sources/zlib.js-0.1.6/ChangeLog.md b/debian/missing-sources/zlib.js-0.1.6/ChangeLog.md deleted file mode 100644 index 6d15ba0f83..0000000000 --- a/debian/missing-sources/zlib.js-0.1.6/ChangeLog.md +++ /dev/null @@ -1,133 +0,0 @@ - -# Change Log - - -## 0.1.6: 2013/05/10 - -https://github.com/imaya/zlib.js/compare/0.1.5...0.1.6 - - -### compression - -- export raw deflate - - -### decompression - -- export raw inflate -- fix inflate stream exporting - - -### etc - -- export crc-32 -- add pretty print build -- optimize compile settings -- add english document -- support source maps -- support Travis CI -- refactor unit test -- update closure compiler (custom version) - - -------------------------------------------------------------------------------- - - -## 0.1.5: 2013/02/10 - -https://github.com/imaya/zlib.js/compare/0.1.4...0.1.5 - - -### compression - -- fix PKZIP CRC-32 bug - - -### etc - -- update PKZIP unit test - - -------------------------------------------------------------------------------- - - -## 0.1.4: 2013/02/10 - -https://github.com/imaya/zlib.js/compare/0.1.3...0.1.4 - - -### compression - -- add PKZIP compression (basic support) - - -### decompression - -- add PKZIP decompression (basic support) - - -### etc - -- refactor build environment (use export js file) -- remove license comment in source code - - -------------------------------------------------------------------------------- - - -## 0.1.3: 2012/12/21 - -https://github.com/imaya/zlib.js/compare/0.1.2...0.1.3 - - -### compression - -- fix rare case bug - - -------------------------------------------------------------------------------- - - -## 0.1.2: 2012/12/17 - -https://github.com/imaya/zlib.js/compare/0.1.1...0.1.2 - - -### compression - -- fix adler-32 bug (byte order) -- refactor raw deflate code - -### decompression - -- refactor inflate stream code - -### etc - -- update closure compiler (custom version) -- update inflate unit test (enable adler-32 verification) - - -------------------------------------------------------------------------------- - - -## 0.1.1: 2012/11/15 - -https://github.com/imaya/zlib.js/compare/0.1.0...0.1.1 - - -### compression - -- fix huffman coding (add reverse package merge algorithm) - -### etc - -- fix gunzip unit test - - -------------------------------------------------------------------------------- - - -## 0.1.0: 2012/09/24 - -- first release \ No newline at end of file diff --git a/debian/missing-sources/zlib.js-0.1.6/LICENSE b/debian/missing-sources/zlib.js-0.1.6/LICENSE deleted file mode 100644 index 489fd6451c..0000000000 --- a/debian/missing-sources/zlib.js-0.1.6/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license - * zlib.js - * JavaScript Zlib Library - * https://github.com/imaya/zlib.js - * - * The MIT License - * - * Copyright (c) 2012 imaya - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ diff --git a/debian/missing-sources/zlib.js-0.1.6/LICENSE_min b/debian/missing-sources/zlib.js-0.1.6/LICENSE_min deleted file mode 100644 index 0694e7c048..0000000000 --- a/debian/missing-sources/zlib.js-0.1.6/LICENSE_min +++ /dev/null @@ -1 +0,0 @@ -/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */ \ No newline at end of file diff --git a/debian/missing-sources/zlib.js-0.1.6/README.en.md b/debian/missing-sources/zlib.js-0.1.6/README.en.md deleted file mode 100644 index 60341241e8..0000000000 --- a/debian/missing-sources/zlib.js-0.1.6/README.en.md +++ /dev/null @@ -1,285 +0,0 @@ -zlib.js -======= - -[![Build Status](https://travis-ci.org/imaya/zlib.js.png?branch=master)](https://travis-ci.org/imaya/zlib.js) - -[Japanese version](./README.md) - -zlib.js is ZLIB(RFC1950), DEFLATE(RFC1951), GZIP(RFC1952) and PKZIP implementation in JavaScript. - - -Usage ------- - -Use one in "bin" directory. - -- zlib_and_gzip.min.js: ZLIB + GZIP - + (Raw) - * rawdeflate.js: Raw Deflate - * rawinflate.js: Raw Inflate - + zlib.min.js: ZLIB Inflate + Deflate - * inflate.min.js: ZLIB Inflate - * deflate.min.js: ZLIB Deflate - * inflate_stream.min.js: ZLIB Inflate (stream mode) - + (GZIP) - * gzip.min.js: GZIP - * gunzip.min.js: GUNZIP - + (PKZIP) - * zip.min.js ZIP - * unzip.min.js UNZIP -- node-zlib.js: (ZLIB + GZIP for node.js) - - -### Compression - -#### Raw Deflate - -```js -// plain = Array. or Uint8Array -var defalte = new Zlib.RawDeflate(plain); -var compressed = deflate.compress(); -``` - -#### Raw Deflate Option - -See ZLIB Option. - -#### ZLIB - -```js -// plain = Array. or Uint8Array -var defalte = new Zlib.Deflate(plain); -var compressed = deflate.compress(); -``` - -##### ZLIB Option - -Second argument of Zlib.Deflate constructor - -```js -{ - compressionType: Zlib.Deflate.CompressionType, // compression type - lazy: number // lazy matching parameter -} -``` - -Zlib.Deflate.CompressionType is enumerable, -Choose one in NONE (Store), FIXED (Fixed Huffman Coding), DYNAMIC (Dynamic Huffman Coding). -Default value is DYNAMIC. - -lazy is Lazy Matching length. -This parameter is deprecated. - - -#### GZIP - -GZIP implementation is imcompleted. -However no problem in usual use. - -```js -// plain = Array. or Uint8Array -var gzip = new Zlib.Gzip(plain); -var compressed = gzip.compress(); -``` - - -##### GZIP Option - -```js -{ - deflateOptions: Object, // see: deflate option (ZLIB Option) - flags: { - fname: boolean, // use filename? - comment: boolean, // use comment? - fhcrc: boolean // use file checksum? - }, - filename: string, // filename - comment: string // comment -} -``` - - -#### PKZIP - -```js -var zip = new Zlib.Zip(); -// plainData1 -zip.addFile(plainData1, { - filename: stringToByteArray('foo.txt') -}); -zip.addFile(plainData2, { - filename: stringToByteArray('bar.txt') -}); -zip.addFile(plainData3, { - filename: stringToByteArray('baz.txt') -}); -var compressed = zip.compress(); - -function stringToByteArray(str) { - var array = new (window.Uint8Array !== void 0 ? Uint8Array : Array)(str.length); - var i; - var il; - - for (i = 0, il = str.length; i < il; ++i) { - array[i] = str.charCodeAt(i) & 0xff; - } - - return array; -} -``` - -##### PKZIP Option - -filename, comment, extraField are must use Uint8Array if enabled Typed Array. - -```js -{ - filename: (Array.|Uint8Array), // filename - comment: (Array.|Uint8Array), //comment - extraField: (Array.|Uint8Array), // extra field - compress: boolean, // compress when called "addFile" method. - compressionMethod: Zlib.Zip.CompressionMethod, // STORE or DEFLATE - os: Zlib.Zip.OperatingSystem, // MSDOS or UNIX or MACINTOSH - deflateOption: Object // see: ZLIB Option -} -``` - -### Decompression - -#### Raw Deflate - -```js -// compressed = Array. or Uint8Array -var inflate = new Zlib.RawInflate(compressed); -var plain = inflate.decompress(); -``` - -#### Raw Deflate Option - -See ZLIB Option. - -#### ZLIB - -```js -// compressed = Array. or Uint8Array -var inflate = new Zlib.Inflate(compressed); -var plain = inflate.decompress(); -``` - -##### ZLIB Option - -Second argument of Zlib.Inflate constructor - -```js -{ - 'index': number, // start position in input buffer - 'bufferSize': number, // initial output buffer size - 'bufferType': Zlib.Inflate.BufferType, // buffer expantion type - 'resize': boolean, // resize buffer(ArrayBuffer) when end of decompression (default: false) - 'verify': boolean // verify decompression result (default: false) -} -``` - -Zlib.Inflate.BufferType is enumerable. -Choose one ADAPTIVE(default) and BLOCK. - -- ADAPTIVE: buffer expansion based on compression ratio in filled buffer. -- BLOCK: buffer expansion based on BufferSize. - - -#### GZIP - -```js -// compressed = Array. or Uint8Array -var gunzip = new Zlib.Gunzip(compressed); -var plain = gunzip.decompress(); -``` - - -#### PKZIP - - -```js -// compressed = Array. or Uint8Array -var unzip = new Zlib.Unzip(compressed); -var filenames = unzip.getFilenames(); -var plain = unzip.decompress(filenames[0]); -``` - - -### Node.js - -see unit tests. - - - -## Debug - -If you want to know the code before compile, SourceMaps and PrettyPrint can be used. - - -### SourceMaps - -If you want to enable the SourceMaps if, you can use the `src` directory and *.min.js.map. - - - inflate.min.js - - inflate.min.js.map - - [src] - - (source files) - -`[src]` is zlib.js source code directory. - - -### Pretty Print - -`zlib.pretty.js` is not renamed symbol. - - -How to build ------------- - -Build using Ant and Closure Compiler. - -### Requirement - -- Ant 1.8+ -- JRE 1.6+ -- Python - -### Build - -Use "ant" command. - -``` -$ ant [target] -``` - -#### Build target - -target | generate file | implementation ----------------|----------------------|------------- -deps | deps.js | (dependency: deps.js) -deflate | deflate.min.js | ZLIB Deflate -inflate | inflate.min.js | ZLIB Inflate -inflate_stream | inlate_stream.min.js | ZLIB Inlate (stream) -zlib | zlib.min.js | ZLIB Deflate + Inflate -gzip | gzip.min.js | GZIP Compression -gunzip | gunzip.min.js | GZIP Decompression -zlib_and_gzip | zlib_and_gzip.min.js | ZLIB + GZIP -node | node-zlib.js | ZLIB + GZIP for node.js -zip | zip.min.js | PKZIP Compression -unzip | unzip.min.js | PKZIP Decompression -all | * | default target - - -Issue ------ - -Preset dictionary is not implemented. - - -License --------- - -Copyright © 2012 imaya. -Licensed under the MIT License. diff --git a/debian/missing-sources/zlib.js-0.1.6/README.md b/debian/missing-sources/zlib.js-0.1.6/README.md deleted file mode 100644 index ad18e41d19..0000000000 --- a/debian/missing-sources/zlib.js-0.1.6/README.md +++ /dev/null @@ -1,307 +0,0 @@ -zlib.js -======= - -[![Build Status](https://travis-ci.org/imaya/zlib.js.png?branch=master)](https://travis-ci.org/imaya/zlib.js) - -[English version](./README.en.md) - -zlib.js は ZLIB(RFC1950), DEFLATE(RFC1951), GZIP(RFC1952), PKZIP の JavaScript 実装です。 - - -使い方 ------- - -zlib.js は必要な機能ごとに分割されています。 -bin ディレクトリから必要なものを利用してください。 - -- zlib_and_gzip.min.js: ZLIB + GZIP - + (Raw) - * rawdeflate.js: Raw Deflate - * rawinflate.js: Raw Inflate - + zlib.min.js: ZLIB Inflate + Deflate - * inflate.min.js: ZLIB Inflate - * deflate.min.js: ZLIB Deflate - * inflate_stream.min.js: ZLIB Inflate (stream mode) - + (GZIP) - * gzip.min.js: GZIP - * gunzip.min.js: GUNZIP - + (PKZIP) - * zip.min.js ZIP - * unzip.min.js UNZIP -- node-zlib.js: (ZLIB + GZIP for node.js) - - -### 圧縮 (Compress) - -#### Raw Deflate - -```js -// plain = Array. or Uint8Array -var defalte = new Zlib.RawDeflate(plain); -var compressed = deflate.compress(); -``` - -#### Raw Deflate Option - -ZLIB Option を参照してください。 - - -#### ZLIB - -```js -// plain = Array. or Uint8Array -var defalte = new Zlib.Deflate(plain); -var compressed = deflate.compress(); -``` - -##### ZLIB Option - -Zlib.Deflate の第二引数にオブジェクトを渡す事で圧縮オプションを指定する事が出来ます。 - -```js -{ - compressionType: Zlib.Deflate.CompressionType, // 圧縮タイプ - lazy: number // lazy matching の閾値 -} -``` - -Zlib.Deflate.CompressionType は -NONE(無圧縮), FIXED(固定ハフマン符号), DYNAMIC(動的ハフマン符号) から選択する事ができます。 -default は DYNAMIC です。 - -lazy は Lazy Matching の閾値を指定します。 -Lazy Matching とは、LZSS のマッチ長が閾値より低かった場合、次の Byte から LZSS の最長一致を試み、マッチ長の長い方を選択する手法です。 - - -#### GZIP - -GZIP の実装は現在不完全ですが、ただの圧縮コンテナとして使用する場合には特に問題はありません。 -zlib.js を用いて作成された GZIP の OS は、自動的に UNKNOWN に設定されます。 - -```js -// plain = Array. or Uint8Array -var gzip = new Zlib.Gzip(plain); -var compressed = gzip.compress(); -``` - - -##### GZIP Option - -```js -{ - deflateOptions: Object, // deflate option (ZLIB Option 参照) - flags: { - fname: boolean, // ファイル名を使用するか - comment: boolean, // コメントを使用するか - fhcrc: boolean // FHCRC を使用するか - }, - filename: string, // flags.fname が true のときに書き込むファイル名 - comment: string // flags.comment が true のときに書き込むコメント -} -``` - - -#### PKZIP - -PKZIP では複数のファイルを扱うため、他のものとは少し使い方が異なります。 - -```js -var zip = new Zlib.Zip(); -// plainData1 -zip.addFile(plainData1, { - filename: stringToByteArray('foo.txt') -}); -zip.addFile(plainData2, { - filename: stringToByteArray('bar.txt') -}); -zip.addFile(plainData3, { - filename: stringToByteArray('baz.txt') -}); -var compressed = zip.compress(); - -function stringToByteArray(str) { - var array = new (window.Uint8Array !== void 0 ? Uint8Array : Array)(str.length); - var i; - var il; - - for (i = 0, il = str.length; i < il; ++i) { - array[i] = str.charCodeAt(i) & 0xff; - } - - return array; -} -``` - -##### PKZIP Option - -filename, comment, extraField は Typed Array が使用可能な場合は必ず Uint8Array を使用してください。 - -```js -{ - filename: (Array.|Uint8Array), // ファイル名 - comment: (Array.|Uint8Array), // コメント - extraField: (Array.|Uint8Array), // その他の領域 - compress: boolean, // addFile メソッドを呼んだときに圧縮するか (通常は compress メソッドの呼び出し時に圧縮) - compressionMethod: Zlib.Zip.CompressionMethod, // STORE or DEFLATE - os: Zlib.Zip.OperatingSystem, // MSDOS or UNIX or MACINTOSH - deflateOption: Object // see: ZLIB Option -} -``` - -### 伸張 (Decompress) - -圧縮されたデータの伸張は、基本的に各コンストラクタに圧縮されたデータを渡し、 -それの decompress メソッドを呼ぶ事で伸張処理を開始する事が出来ます。 - -#### Raw Deflate - -```js -// compressed = Array. or Uint8Array -var inflate = new Zlib.RawInflate(compressed); -var plain = inflate.decompress(); -``` - -#### Raw Deflate Option - -ZLIB Option を参照してください。 - -#### ZLIB - -```js -// compressed = Array. or Uint8Array -var inflate = new Zlib.Inflate(compressed); -var plain = inflate.decompress(); -``` - -##### ZLIB Option - -Zlib.Inflate の第二引数にオブジェクトを渡す事で伸張オプションを指定する事ができます。 - -```js -{ - 'index': number, // 入力バッファの開始位置 - 'bufferSize': number, // 出力バッファの初期サイズ - 'bufferType': Zlib.Inflate.BufferType, // バッファの管理方法 - 'resize': boolean, // 出力バッファのリサイズ - 'verify': boolean // 伸張結果の検証を行うか -} -``` - -Zlib.Inflate.BufferType は ADAPTIVE(default) か BLOCK を選択する事ができます。 - -- ADAPTIVE はバッファを伸張後のサイズを予測して一気に拡張しますが、データによっては余分にメモリを使用しすぎる事があります。 -- BLOCK では BufferSize ずつ拡張していきますが、動作はあまり速くありません。 - -resize オプションは Typed Array 利用可能時 -decompress メソッドで返却する値の ArrayBuffer を Uint8Array の長さまで縮小させます。 -default は false です。 - -verify オプションは Adler-32 Checksum の検証を行うかを指定します。 -default は false です。 - - -#### GZIP - -```js -// compressed = Array. or Uint8Array -var gunzip = new Zlib.Gunzip(compressed); -var plain = gunzip.decompress(); -``` - -Gunzip のオプションは現在ありません。 - - -#### PKZIP - -PKZIP の構築と同様に複数ファイルを扱うため、他のものとは少し使い方が異なります。 - -```js -// compressed = Array. or Uint8Array -var unzip = new Zlib.Unzip(compressed); -var filenames = unzip.getFilenames(); -var plain = unzip.decompress(filenames[0]); -``` - -Unzip のオプションは現在ありません。 - - -### Node.js - -Node.js で使用する場合はユニットテストを参照してください。 - - - -## Debug - -zlib.js では JavaScript ファイルを minify された形で提供していますが、開発中やデバッグ時に minify する前の状態が知りたい事があります。 -そういった時のために SourceMaps ファイルや Pretty Print されたファイルも提供しています。 - - -### SourceMaps - -SourceMaps を有効にするには以下のように対象となるファイルに `.map` を付けたファイルと、変換前のソースコードである `src` ディレクトリを配置します。 - - - inflate.min.js - - inflate.min.js.map - - [src] - - (source files) - -なお、ここに書いてある `[src]` は zlib.js のリポジトリの `src` ディレクトリをコピーしてください。 - - -### Pretty Print - -SourceMaps とは異なりますが、minify の変数名の短縮のみ避けられれば良いという場合には、 Closure Compiler で読みやすくしたファイルを利用することも可能です。 -`zlib.pretty.js` というファイル名で全ての実装がはいっていますので、minify されたものをこのファイルに置き換えるだけで使用できます。 - - - -How to build ------------- - -ビルドは Ant と Closure Compiler を使用して行います。 - -### 必要な環境 - -- Ant 1.8+ -- JRE 1.6+ -- Python - -### ビルド - -Ant を使ってビルドを行います。 - -``` -$ ant [target] -``` - -#### ビルドターゲット - -target | ファイル名 | 含まれる実装 ----------------|----------------------|------------- -deps | deps.js | 依存関係の解決 -deflate | deflate.min.js | ZLIB Deflate -inflate | inflate.min.js | ZLIB Inflate -inflate_stream | inlate_stream.min.js | ZLIB Inlate (stream) -zlib | zlib.min.js | ZLIB Deflate + Inflate -gzip | gzip.min.js | GZIP Compression -gunzip | gunzip.min.js | GZIP Decompression -zlib_and_gzip | zlib_and_gzip.min.js | ZLIB + GZIP -node | node-zlib.js | ZLIB + GZIP for node.js -zip | zip.min.js | PKZIP Compression -unzip | unzip.min.js | PKZIP Decompression -all | * | default target - - -Issue ------ - -現在プリセット辞書を用いた圧縮形式には対応していません。 -プリセット辞書は通常の圧縮では利用されないため、影響は少ないと思います。 - - -ライセンス ------------ - -Copyright © 2012 imaya. -Licensed under the MIT License. diff --git a/debian/missing-sources/zlib.js-0.1.6/bin/rawinflate.min.js b/debian/missing-sources/zlib.js-0.1.6/bin/rawinflate.min.js deleted file mode 100644 index f9c7f87ecd..0000000000 --- a/debian/missing-sources/zlib.js-0.1.6/bin/rawinflate.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {'use strict';var l=void 0,p=this;function q(c,d){var a=c.split("."),b=p;!(a[0]in b)&&b.execScript&&b.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)!a.length&&d!==l?b[e]=d:b=b[e]?b[e]:b[e]={}};var r="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array;function u(c){var d=c.length,a=0,b=Number.POSITIVE_INFINITY,e,f,g,h,k,m,s,n,t;for(n=0;na&&(a=c[n]),c[n]>=1;for(t=m;t>>=1;switch(c){case 0:var d=this.input,a=this.d,b=this.b,e=this.a,f=l,g=l,h=l,k=b.length,m=l;this.c=this.f=0;f=d[a++];if(f===l)throw Error("invalid uncompressed block header: LEN (first byte)");g=f;f=d[a++];if(f===l)throw Error("invalid uncompressed block header: LEN (second byte)");g|=f<<8;f=d[a++];if(f===l)throw Error("invalid uncompressed block header: NLEN (first byte)");h=f;f=d[a++];if(f===l)throw Error("invalid uncompressed block header: NLEN (second byte)");h|= -f<<8;if(g===~h)throw Error("invalid uncompressed block header: length verify");if(a+g>d.length)throw Error("input buffer is broken");switch(this.i){case x:for(;e+g>b.length;){m=k-e;g-=m;if(r)b.set(d.subarray(a,a+m),e),e+=m,a+=m;else for(;m--;)b[e++]=d[a++];this.a=e;b=this.e();e=this.a}break;case w:for(;e+g>b.length;)b=this.e({o:2});break;default:throw Error("invalid inflate mode");}if(r)b.set(d.subarray(a,a+g),e),e+=g,a+=g;else for(;g--;)b[e++]=d[a++];this.d=a;this.a=e;this.b=b;break;case 1:this.j(z, -A);break;case 2:B(this);break;default:throw Error("unknown BTYPE: "+c);}}return this.m()}; -var C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],D=r?new Uint16Array(C):C,E=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],F=r?new Uint16Array(E):E,G=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],H=r?new Uint8Array(G):G,I=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],J=r?new Uint16Array(I):I,K=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13, -13],L=r?new Uint8Array(K):K,M=new (r?Uint8Array:Array)(288),N,O;N=0;for(O=M.length;N=N?8:255>=N?9:279>=N?7:8;var z=u(M),P=new (r?Uint8Array:Array)(30),Q,R;Q=0;for(R=P.length;Q>>d;c.c=b-d;c.d=f;return g} -function S(c,d){for(var a=c.f,b=c.c,e=c.input,f=c.d,g=d[0],h=d[1],k,m,s;b>>16;c.f=a>>s;c.c=b-s;c.d=f;return m&65535} -function B(c){function d(a,c,b){var d,f,e,g;for(g=0;gf)b>=e&&(this.a=b,a=this.e(),b=this.a),a[b++]=f;else{g=f-257;k=F[g];0=e&&(this.a=b,a=this.e(),b=this.a);for(;k--;)a[b]=a[b++-h]}for(;8<=this.c;)this.c-=8,this.d--;this.a=b}; -v.prototype.s=function(c,d){var a=this.b,b=this.a;this.n=c;for(var e=a.length,f,g,h,k;256!==(f=S(this,c));)if(256>f)b>=e&&(a=this.e(),e=a.length),a[b++]=f;else{g=f-257;k=F[g];0e&&(a=this.e(),e=a.length);for(;k--;)a[b]=a[b++-h]}for(;8<=this.c;)this.c-=8,this.d--;this.a=b}; -v.prototype.e=function(){var c=new (r?Uint8Array:Array)(this.a-32768),d=this.a-32768,a,b,e=this.b;if(r)c.set(e.subarray(32768,c.length));else{a=0;for(b=c.length;aa;++a)e[a]=e[d+a];this.a=32768;return e}; -v.prototype.u=function(c){var d,a=this.input.length/this.d+1|0,b,e,f,g=this.input,h=this.b;c&&("number"===typeof c.o&&(a=c.o),"number"===typeof c.q&&(a+=c.q));2>a?(b=(g.length-this.d)/this.n[2],f=258*(b/2)|0,e=fd&&(this.b.length=d),c=this.b);return this.buffer=c};q("Zlib.RawInflate",v);q("Zlib.RawInflate.prototype.decompress",v.prototype.t);var T={ADAPTIVE:w,BLOCK:x},U,V,W,X;if(Object.keys)U=Object.keys(T);else for(V in U=[],W=0,T)U[W++]=V;W=0;for(X=U.length;W - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/debian/missing-sources/zlib.js-0.1.6/closure-primitives/base.js b/debian/missing-sources/zlib.js-0.1.6/closure-primitives/base.js deleted file mode 100644 index 40483dc18a..0000000000 --- a/debian/missing-sources/zlib.js-0.1.6/closure-primitives/base.js +++ /dev/null @@ -1,1498 +0,0 @@ -// Copyright 2006 The Closure Library Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS-IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/** - * @fileoverview Bootstrap for the Google JS Library (Closure). - * - * In uncompiled mode base.js will write out Closure's deps file, unless the - * global CLOSURE_NO_DEPS is set to true. This allows projects to - * include their own deps file(s) from different locations. - * - */ - - -/** - * @define {boolean} Overridden to true by the compiler when --closure_pass - * or --mark_as_compiled is specified. - */ -var COMPILED = false; - - -/** - * Base namespace for the Closure library. Checks to see goog is - * already defined in the current scope before assigning to prevent - * clobbering if base.js is loaded more than once. - * - * @const - */ -var goog = goog || {}; // Identifies this file as the Closure base. - - -/** - * Reference to the global context. In most cases this will be 'window'. - */ -goog.global = this; - - -/** - * @define {boolean} DEBUG is provided as a convenience so that debugging code - * that should not be included in a production js_binary can be easily stripped - * by specifying --define goog.DEBUG=false to the JSCompiler. For example, most - * toString() methods should be declared inside an "if (goog.DEBUG)" conditional - * because they are generally used for debugging purposes and it is difficult - * for the JSCompiler to statically determine whether they are used. - */ -goog.DEBUG = true; - - -/** - * @define {string} LOCALE defines the locale being used for compilation. It is - * used to select locale specific data to be compiled in js binary. BUILD rule - * can specify this value by "--define goog.LOCALE=" as JSCompiler - * option. - * - * Take into account that the locale code format is important. You should use - * the canonical Unicode format with hyphen as a delimiter. Language must be - * lowercase, Language Script - Capitalized, Region - UPPERCASE. - * There are few examples: pt-BR, en, en-US, sr-Latin-BO, zh-Hans-CN. - * - * See more info about locale codes here: - * http://www.unicode.org/reports/tr35/#Unicode_Language_and_Locale_Identifiers - * - * For language codes you should use values defined by ISO 693-1. See it here - * http://www.w3.org/WAI/ER/IG/ert/iso639.htm. There is only one exception from - * this rule: the Hebrew language. For legacy reasons the old code (iw) should - * be used instead of the new code (he), see http://wiki/Main/IIISynonyms. - */ -goog.LOCALE = 'en'; // default to en - - -/** - * Creates object stubs for a namespace. The presence of one or more - * goog.provide() calls indicate that the file defines the given - * objects/namespaces. Build tools also scan for provide/require statements - * to discern dependencies, build dependency files (see deps.js), etc. - * @see goog.require - * @param {string} name Namespace provided by this file in the form - * "goog.package.part". - */ -goog.provide = function(name) { - if (!COMPILED) { - // Ensure that the same namespace isn't provided twice. This is intended - // to teach new developers that 'goog.provide' is effectively a variable - // declaration. And when JSCompiler transforms goog.provide into a real - // variable declaration, the compiled JS should work the same as the raw - // JS--even when the raw JS uses goog.provide incorrectly. - if (goog.isProvided_(name)) { - throw Error('Namespace "' + name + '" already declared.'); - } - delete goog.implicitNamespaces_[name]; - - var namespace = name; - while ((namespace = namespace.substring(0, namespace.lastIndexOf('.')))) { - if (goog.getObjectByName(namespace)) { - break; - } - goog.implicitNamespaces_[namespace] = true; - } - } - - goog.exportPath_(name); -}; - - -/** - * Marks that the current file should only be used for testing, and never for - * live code in production. - * @param {string=} opt_message Optional message to add to the error that's - * raised when used in production code. - */ -goog.setTestOnly = function(opt_message) { - if (COMPILED && !goog.DEBUG) { - opt_message = opt_message || ''; - throw Error('Importing test-only code into non-debug environment' + - opt_message ? ': ' + opt_message : '.'); - } -}; - - -if (!COMPILED) { - - /** - * Check if the given name has been goog.provided. This will return false for - * names that are available only as implicit namespaces. - * @param {string} name name of the object to look for. - * @return {boolean} Whether the name has been provided. - * @private - */ - goog.isProvided_ = function(name) { - return !goog.implicitNamespaces_[name] && !!goog.getObjectByName(name); - }; - - /** - * Namespaces implicitly defined by goog.provide. For example, - * goog.provide('goog.events.Event') implicitly declares - * that 'goog' and 'goog.events' must be namespaces. - * - * @type {Object} - * @private - */ - goog.implicitNamespaces_ = {}; -} - - -/** - * Builds an object structure for the provided namespace path, - * ensuring that names that already exist are not overwritten. For - * example: - * "a.b.c" -> a = {};a.b={};a.b.c={}; - * Used by goog.provide and goog.exportSymbol. - * @param {string} name name of the object that this file defines. - * @param {*=} opt_object the object to expose at the end of the path. - * @param {Object=} opt_objectToExportTo The object to add the path to; default - * is |goog.global|. - * @private - */ -goog.exportPath_ = function(name, opt_object, opt_objectToExportTo) { - var parts = name.split('.'); - var cur = opt_objectToExportTo || goog.global; - - // Internet Explorer exhibits strange behavior when throwing errors from - // methods externed in this manner. See the testExportSymbolExceptions in - // base_test.html for an example. - if (!(parts[0] in cur) && cur.execScript) { - cur.execScript('var ' + parts[0]); - } - - // Certain browsers cannot parse code in the form for((a in b); c;); - // This pattern is produced by the JSCompiler when it collapses the - // statement above into the conditional loop below. To prevent this from - // happening, use a for-loop and reserve the init logic as below. - - // Parentheses added to eliminate strict JS warning in Firefox. - for (var part; parts.length && (part = parts.shift());) { - if (!parts.length && goog.isDef(opt_object)) { - // last part and we have an object; use it - cur[part] = opt_object; - } else if (cur[part]) { - cur = cur[part]; - } else { - cur = cur[part] = {}; - } - } -}; - - -/** - * Returns an object based on its fully qualified external name. If you are - * using a compilation pass that renames property names beware that using this - * function will not find renamed properties. - * - * @param {string} name The fully qualified name. - * @param {Object=} opt_obj The object within which to look; default is - * |goog.global|. - * @return {?} The value (object or primitive) or, if not found, null. - */ -goog.getObjectByName = function(name, opt_obj) { - var parts = name.split('.'); - var cur = opt_obj || goog.global; - for (var part; part = parts.shift(); ) { - if (goog.isDefAndNotNull(cur[part])) { - cur = cur[part]; - } else { - return null; - } - } - return cur; -}; - - -/** - * Globalizes a whole namespace, such as goog or goog.lang. - * - * @param {Object} obj The namespace to globalize. - * @param {Object=} opt_global The object to add the properties to. - * @deprecated Properties may be explicitly exported to the global scope, but - * this should no longer be done in bulk. - */ -goog.globalize = function(obj, opt_global) { - var global = opt_global || goog.global; - for (var x in obj) { - global[x] = obj[x]; - } -}; - - -/** - * Adds a dependency from a file to the files it requires. - * @param {string} relPath The path to the js file. - * @param {Array} provides An array of strings with the names of the objects - * this file provides. - * @param {Array} requires An array of strings with the names of the objects - * this file requires. - */ -goog.addDependency = function(relPath, provides, requires) { - if (!COMPILED) { - var provide, require; - var path = relPath.replace(/\\/g, '/'); - var deps = goog.dependencies_; - for (var i = 0; provide = provides[i]; i++) { - deps.nameToPath[provide] = path; - if (!(path in deps.pathToNames)) { - deps.pathToNames[path] = {}; - } - deps.pathToNames[path][provide] = true; - } - for (var j = 0; require = requires[j]; j++) { - if (!(path in deps.requires)) { - deps.requires[path] = {}; - } - deps.requires[path][require] = true; - } - } -}; - - - - -// NOTE(nnaze): The debug DOM loader was included in base.js as an orignal -// way to do "debug-mode" development. The dependency system can sometimes -// be confusing, as can the debug DOM loader's asyncronous nature. -// -// With the DOM loader, a call to goog.require() is not blocking -- the -// script will not load until some point after the current script. If a -// namespace is needed at runtime, it needs to be defined in a previous -// script, or loaded via require() with its registered dependencies. -// User-defined namespaces may need their own deps file. See http://go/js_deps, -// http://go/genjsdeps, or, externally, DepsWriter. -// http://code.google.com/closure/library/docs/depswriter.html -// -// Because of legacy clients, the DOM loader can't be easily removed from -// base.js. Work is being done to make it disableable or replaceable for -// different environments (DOM-less JavaScript interpreters like Rhino or V8, -// for example). See bootstrap/ for more information. - - -/** - * @define {boolean} Whether to enable the debug loader. - * - * If enabled, a call to goog.require() will attempt to load the namespace by - * appending a script tag to the DOM (if the namespace has been registered). - * - * If disabled, goog.require() will simply assert that the namespace has been - * provided (and depend on the fact that some outside tool correctly ordered - * the script). - */ -goog.ENABLE_DEBUG_LOADER = true; - - -/** - * Implements a system for the dynamic resolution of dependencies - * that works in parallel with the BUILD system. Note that all calls - * to goog.require will be stripped by the JSCompiler when the - * --closure_pass option is used. - * @see goog.provide - * @param {string} name Namespace to include (as was given in goog.provide()) - * in the form "goog.package.part". - */ -goog.require = function(name) { - - // if the object already exists we do not need do do anything - // TODO(arv): If we start to support require based on file name this has - // to change - // TODO(arv): If we allow goog.foo.* this has to change - // TODO(arv): If we implement dynamic load after page load we should probably - // not remove this code for the compiled output - if (!COMPILED) { - if (goog.isProvided_(name)) { - return; - } - - if (goog.ENABLE_DEBUG_LOADER) { - var path = goog.getPathFromDeps_(name); - if (path) { - goog.included_[path] = true; - goog.writeScripts_(); - return; - } - } - - var errorMessage = 'goog.require could not find: ' + name; - if (goog.global.console) { - goog.global.console['error'](errorMessage); - } - - - throw Error(errorMessage); - - } -}; - - -/** - * Path for included scripts - * @type {string} - */ -goog.basePath = ''; - - -/** - * A hook for overriding the base path. - * @type {string|undefined} - */ -goog.global.CLOSURE_BASE_PATH; - - -/** - * Whether to write out Closure's deps file. By default, - * the deps are written. - * @type {boolean|undefined} - */ -goog.global.CLOSURE_NO_DEPS; - - -/** - * A function to import a single script. This is meant to be overridden when - * Closure is being run in non-HTML contexts, such as web workers. It's defined - * in the global scope so that it can be set before base.js is loaded, which - * allows deps.js to be imported properly. - * - * The function is passed the script source, which is a relative URI. It should - * return true if the script was imported, false otherwise. - */ -goog.global.CLOSURE_IMPORT_SCRIPT; - - -/** - * Null function used for default values of callbacks, etc. - * @return {void} Nothing. - */ -goog.nullFunction = function() {}; - - -/** - * The identity function. Returns its first argument. - * - * @param {*=} opt_returnValue The single value that will be returned. - * @param {...*} var_args Optional trailing arguments. These are ignored. - * @return {?} The first argument. We can't know the type -- just pass it along - * without type. - * @deprecated Use goog.functions.identity instead. - */ -goog.identityFunction = function(opt_returnValue, var_args) { - return opt_returnValue; -}; - - -/** - * When defining a class Foo with an abstract method bar(), you can do: - * - * Foo.prototype.bar = goog.abstractMethod - * - * Now if a subclass of Foo fails to override bar(), an error - * will be thrown when bar() is invoked. - * - * Note: This does not take the name of the function to override as - * an argument because that would make it more difficult to obfuscate - * our JavaScript code. - * - * @type {!Function} - * @throws {Error} when invoked to indicate the method should be - * overridden. - */ -goog.abstractMethod = function() { - throw Error('unimplemented abstract method'); -}; - - -/** - * Adds a {@code getInstance} static method that always return the same instance - * object. - * @param {!Function} ctor The constructor for the class to add the static - * method to. - */ -goog.addSingletonGetter = function(ctor) { - ctor.getInstance = function() { - if (ctor.instance_) { - return ctor.instance_; - } - if (goog.DEBUG) { - // NOTE: JSCompiler can't optimize away Array#push. - goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = ctor; - } - return ctor.instance_ = new ctor; - }; -}; - - -/** - * All singleton classes that have been instantiated, for testing. Don't read - * it directly, use the {@code goog.testing.singleton} module. The compiler - * removes this variable if unused. - * @type {!Array.} - * @private - */ -goog.instantiatedSingletons_ = []; - - -if (!COMPILED && goog.ENABLE_DEBUG_LOADER) { - /** - * Object used to keep track of urls that have already been added. This - * record allows the prevention of circular dependencies. - * @type {Object} - * @private - */ - goog.included_ = {}; - - - /** - * This object is used to keep track of dependencies and other data that is - * used for loading scripts - * @private - * @type {Object} - */ - goog.dependencies_ = { - pathToNames: {}, // 1 to many - nameToPath: {}, // 1 to 1 - requires: {}, // 1 to many - // used when resolving dependencies to prevent us from - // visiting the file twice - visited: {}, - written: {} // used to keep track of script files we have written - }; - - - /** - * Tries to detect whether is in the context of an HTML document. - * @return {boolean} True if it looks like HTML document. - * @private - */ - goog.inHtmlDocument_ = function() { - var doc = goog.global.document; - return typeof doc != 'undefined' && - 'write' in doc; // XULDocument misses write. - }; - - - /** - * Tries to detect the base path of the base.js script that bootstraps Closure - * @private - */ - goog.findBasePath_ = function() { - if (goog.global.CLOSURE_BASE_PATH) { - goog.basePath = goog.global.CLOSURE_BASE_PATH; - return; - } else if (!goog.inHtmlDocument_()) { - return; - } - var doc = goog.global.document; - var scripts = doc.getElementsByTagName('script'); - // Search backwards since the current script is in almost all cases the one - // that has base.js. - for (var i = scripts.length - 1; i >= 0; --i) { - var src = scripts[i].src; - var qmark = src.lastIndexOf('?'); - var l = qmark == -1 ? src.length : qmark; - if (src.substr(l - 7, 7) == 'base.js') { - goog.basePath = src.substr(0, l - 7); - return; - } - } - }; - - - /** - * Imports a script if, and only if, that script hasn't already been imported. - * (Must be called at execution time) - * @param {string} src Script source. - * @private - */ - goog.importScript_ = function(src) { - var importScript = goog.global.CLOSURE_IMPORT_SCRIPT || - goog.writeScriptTag_; - if (!goog.dependencies_.written[src] && importScript(src)) { - goog.dependencies_.written[src] = true; - } - }; - - - /** - * The default implementation of the import function. Writes a script tag to - * import the script. - * - * @param {string} src The script source. - * @return {boolean} True if the script was imported, false otherwise. - * @private - */ - goog.writeScriptTag_ = function(src) { - if (goog.inHtmlDocument_()) { - var doc = goog.global.document; - doc.write( - '